import pandas as pd
df1 = pd.read_csv(r'C:\Users\Wang\Desktop\data\stock_small.csv')
df = df1.iloc[:, [0, 1, 2, 3, 6]]  #<交易所> <股票代码> <交易⽇期>  <开盘价><收盘价>
def x(a,b):
    return a - b
df['stock_price_arbitrage']  = df.apply(lambda f: x(f['stock_price_close'],f['stock_price_open']), axis=1)
df = df.sort_values(by="stock_price_arbitrage",ascending=False)
df2=df.iloc[0:10,0:6]
print(df2)